﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CoreInmobiliario.Frontend.HelperClasses
{
    public static class Utils
    {

        public static string GetConfig(string tagName)
        {
            string keyValue = string.Empty;
            System.Configuration.Configuration rootWebConfig = null;

            try
            {
                rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
            }
            catch (Exception ex)
            {
                //No se pudo leer el web.config
            }

            if (rootWebConfig != null)
            {
                try
                {
                    keyValue = rootWebConfig.AppSettings.Settings[tagName].Value;
                }
                catch (Exception ex)
                {
                    //No se pudo leer el tag del web.config
                }
            }

            return keyValue;
        }

    }
}